package cn.sibu.tuchapplication;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;

public class MainActivity extends AppCompatActivity implements View.OnClickListener{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
       // PanGestureScrollView panGestureScrollView = new PanGestureScrollView(this);
        PanScrollView scrollView = new PanScrollView(this);
        LinearLayout layout = new LinearLayout(this);
        layout.setOrientation(LinearLayout.HORIZONTAL);
        for(int i = 0 ;i<5 ;i++){
            //ImageView iv = new ImageButton(this);
            ImageView iv = new ImageView(this);
            iv.setImageResource(R.mipmap.ic_launcher);
            iv.setOnClickListener(this);
            //让每个视图可以足够大来请求滚动
            //layout.addView(iv,new LinearLayout.LayoutParams(500,500));
        }
        //panGestureScrollView.addView(layout);
        scrollView.addView(layout);
        TouchDelegateLayout delegateLayout = new TouchDelegateLayout(this);
        setContentView(R.layout.activity_main);
        findViewById(R.id.btn_touch).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
       // Toast.makeText(this,"ahaha",Toast.LENGTH_SHORT).show();
        Intent intent = new Intent(this,RemoteScrollActivity.class);
        startActivity(intent);
    }
}
